import request from '#/utils/requestAbort';

/**
 * 通用
 */
// 现货数据
export async function getSpotPrice(data) {
  if (data.marketId === 'PDBLJ' || data.marketId === 'PXBNX') {
    // 处理 黑龙江 的特殊逻辑
    return request(`/market-disclosure/ptdGridKeyIndicatorPointMonitor/getSpotPrice`, {
      method: 'post',
      data,
    });
  }
  return request(`/disclosure/ptdGridKeyIndicatorPointMonitor/getSpotPrice`, {
    method: 'post',
    data,
  });
}

// 其他数据
export async function getRunDataList(params) {
  if (params.marketId === 'PDBLJ' || params.marketId === 'PXBNX') {
    // 处理 黑龙江 的特殊逻辑
    return request('/market-disclosure/markettransaction/getRunDataList', {
      method: 'POST',
      data: params,
    });
  } else {
    return request('/disclosure/ptdGridKeyIndicatorPointMonitor/getRunDataList', {
      method: 'POST',
      data: params,
    });
  }
}

/**
 * 蒙西
 */
// 图数据
export async function getMengxiMarketSupplyDemandForecastData(params) {
  return request(
    '/disclosure/ptdGridKeyIndicatorPointMonitor/getMengxiMarketSupplyDemandForecastData',
    {
      method: 'POST',
      data: params,
    },
  );
}

// 查询检修信息
export async function getMengxiMaintenanceInformationInfo(params) {
  return request(
    '/disclosure/ptdGridKeyIndicatorPointMonitor/getMengxiMaintenanceInformationInfo',
    {
      method: 'POST',
      data: params,
    },
  );
}

// 其他数据
export async function getPassageNameList(params) {
  return request('/disclosure/gansuProvinceSpot/getPassageName', {
    method: 'POST',
    data: params,
  });
}

// 其他数据
export async function getPassageNameListNew(params) {
  return request('/disclosure/gansuProvinceSpot/getLongTermPassageName', {
    method: 'POST',
    data: params,
  });
}

// 查询通道列表
export async function getGansuRunDataList(params) {
  return request('/disclosure/gansuProvinceSpot/getRunDataList', {
    method: 'POST',
    data: params,
  });
}
